import request from '@/router/axios';

export const getStatistics = (current, size, params, groupByList) => {
  return request({
    url: '/api/log-statistical/statistics',
    method: 'get',
    params: {
      ...params,
      groupByList,
      current,
      size,
    }
  })
}

export const getStatisticsForLoginError = (current, size, params, groupByList) => {
  return request({
    url: '/api/log-statistical/statistics/login-error',
    method: 'get',
    params: {
      ...params,
      groupByList,
      current,
      size,
    }
  })
}

export const getCountryCascader = () => {
  return request({
    url: '/api/log-statistical/getCountryCascader',
    method: 'get',
    timeout: 60000
  })
}

export const getProvinceByCountry = (country) => {
  return request({
    url: '/api/log-statistical/getProvinceByCountry',
    method: 'get',
    params: {
      country
    },
    timeout: 60000
  })
}

export const getCityByProvince = (province) => {
  return request({
    url: '/api/log-statistical/getCityByProvince',
    method: 'get',
    params: {
      province
    },
    timeout: 60000
  })
}